package day2;

import java.util.Random;

public class Homework1CopyArray {
	public static void main(String[] args){
		int[] arr={1,2,3,4,5};
		int[] arr1={6,7,8,9,10};
		int[] arrcopy=copyarr(arr,arr1);
		
		for(int i=0;i<arrcopy.length;i++){
			System.out.print(arrcopy[i]+" ");
		}
	}
	
	public static int[] copyarr(int[] arr,int[] arr1){ 
		Random r=new Random();
		
		int[] arrA= new int[5];
		for(int i=0;i<arrA.length;i++){
			int num=r.nextInt(2);
			if(num==0){
				arrA[i]=arr[i];
			}else{
				arrA[i]=arr1[i];
			}
		}
		return arrA;
	}
}
